//
// memwatch.h
// libprotea
// Tools Library for the Protea Project / Memory debugging functionality
// Copyright (C) 2003, 2004, 2005 eXegeSys, Inc.
// Copyright (C) 2008 Bruce A. James
//
// This program is part of the Protea Project.
//
// The Protea Project is free software; you can redistribute it and/or modify it 
// under the terms of the GNU General Public License as published by the 
// Free Software Foundation, either version 3 of the License, or (at your 
// option) any later version.
//
// The Protea Project is distributed in the hope that it will be useful, but 
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
// for more details.
// 
// You should have received a copy of the GNU General Public License along 
// with this program.  If not, see <http://www.gnu.org/licenses/>.
// 
// Please send correspondence to:
// 
// theproteaproject@gmail.com
//

#ifndef __PROTEA_MEMWATCH_H__
#define __PROTEA_MEMWATCH_H__

#ifdef USE_MEM_WATCH

extern void* XCGetMem( unsigned int size, const char* fname, int line, bool array );
extern void XCFreeMem( void* ptr, bool array );


/*
inline void* operator new( unsigned int size )
{
	return XCGetMem( size, NULL, 0, false );
};

inline void* operator new[]( unsigned int size )
{
	return XCGetMem( size, NULL, 0, true );
};

inline void* operator new( unsigned int size, const char *fname, int line )
{
	return XCGetMem( size, fname, line, false );
}

inline void* operator new[]( unsigned int size, const char *fname, int line )
{
	return XCGetMem( size, fname, line, true );
}

inline void operator delete( void* ptr ) {
	XCFreeMem( ptr, false );
};

inline void operator delete[]( void* ptr ) {
	XCFreeMem( ptr, true );
};

#define new new (__FILE__, __LINE__ )

*/
#endif
 
#endif
